package src.com.snake;

/**
 * @author Zhao
 * @verson
 */
public class snake1 {

    //定义两个数组
    //蛇的长度 ：
    int length;
    //一个数组，专门存储蛇的x轴坐标
    int[] snakeX = new int[200];
    //一个数组，专门存储蛇的y轴坐标
    int[] snakeY = new int[200];
    //游戏只有两个状态，开始，暂停：
    boolean isStart = false;//默认游戏是暂停效果
    //定义蛇的行走方向：
    String direction ;
    //定义食物的x，y轴坐标：
    int foodX;
    int foodY;
    //定义一个积分：
    int score;
    //加入一个变量，判断小蛇的死亡状态：
    boolean isDie = false;//默认情况下小蛇没有死亡

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int[] getSnakeX() {
        return snakeX;
    }

    public void setSnakeX(int[] snakeX) {
        this.snakeX = snakeX;
    }

    public int[] getSnakeY() {
        return snakeY;
    }

    public void setSnakeY(int[] snakeY) {
        this.snakeY = snakeY;
    }

    public boolean getisStart() {
        return isStart;
    }

    public void setisStart(boolean start) {
        isStart = start;
    }

    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }

    public int getFoodX() {
        return foodX;
    }

    public void setFoodX(int foodX) {
        this.foodX = foodX;
    }

    public int getFoodY() {
        return foodY;
    }

    public void setFoodY(int foodY) {
        this.foodY = foodY;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public boolean getisDie() {
        return isDie;
    }
    public void setisDie(boolean die) {
        isDie = die;
    }

    public snake1() {
    }

    public snake1(int length, int[] snakeX, int[] snakeY, boolean isStart, String direction, int foodX, int foodY, int score, boolean isDie) {
        this.length = length;
        this.snakeX = snakeX;
        this.snakeY = snakeY;
        this.isStart = isStart;
        this.direction = direction;
        this.foodX = foodX;
        this.foodY = foodY;
        this.score = score;
        this.isDie = isDie;
    }

    public void init(){
        //初始化蛇的长度：
        length = 3;
        //初始化蛇头坐标：
        snakeX[0] = 175;
        snakeY[0] = 275;
        //初始化第一节身子坐标：
        snakeX[1] = 150;
        snakeY[1] = 275;
        //初始化第二节身子坐标：
        snakeX[2] = 125;
        snakeY[2] = 275;
        //初始化蛇头的方向：
        direction = "R"; // U  D  L R
        //初始化食物的坐标：
        foodX = 300;
        foodY = 200;

    }
}
